﻿using BaseDll;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UserData
{
    [Serializable]
    public class TestInfo
    {
        public string Name { get; set; }
        public dynamic Value {
            get { return S; }
            set
            {
                S = value;
                IsUse = true;
            }
        }
        dynamic S;
        public int PointCount { get; set; } = 10;
        public string Max { get; set; } = "/";
        public string Min { get; set; } = "/";
        public bool IsUse { get; set; } = false;
        public override string ToString()
        {
            object obj = Value;
            if (obj != null)
                return obj.ToString();
            else
                return "";
        }
    }

    public class SaveAdditionalInfo
    {
        public TestInfo time_当前时间 { get; set; } = new TestInfo { Name = "当前时间", Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Max = " ", Min = " " };
        public TestInfo str_Name { get; set; } = new TestInfo { Name = "名称", Value = "", Max = " ", Min = " " };


    }


    public class UserTest
    {
        
        public static TestResult[] Result = new TestResult[4] { new TestResult(), new TestResult(), new TestResult(), new TestResult() };
      
    }
    public class TestResult
    {
        public TestInfo str_机型 { get; set; } = new TestInfo { Name = "机型", Value = "", Max = " ", Min = " " };
        public TestInfo str_批次 { get; set; } = new TestInfo { Name = "批次", Value = "", Max = " ", Min = " " };
        public TestInfo str_操作者 { get; set; } = new TestInfo { Name = "设备操作者", Value = "", Max = " ", Min = " " };
        public TestInfo str_设备编号 { get; set; } = new TestInfo { Name = "设备编号", Value = "", Max = " ", Min = " " };
        public TestInfo str_工站编号 { get; set; } = new TestInfo { Name = "工站编号", Value = "", Max = " ", Min = " " };
        public TestInfo str_治具编号 { get; set; } = new TestInfo { Name = "治具号", Value = "", Max = " ", Min = " " };
        public TestInfo str_外壳SN { get; set; } = new TestInfo { Name = "外壳SN", Value = "", Max = " ", Min = " " };
        public TestInfo FailStep { get; set; } = new TestInfo { Name = "NG原因", Value = "", Max = " ", Min = " " };
        public TestInfo StarTime { get; set; } = new TestInfo { Name = "开始时间", Value = DateTime.Now, Max = " ", Min = " " };
        public TestInfo EndTime { get; set; } = new TestInfo { Name = "结束时间", Value = DateTime.Now, Max = " ", Min = " " };
        public TestInfo TestTime { get; set; } = new TestInfo { Name = "测试时间", Value = 0.00, Max = " ", Min = " " };
        public TestInfo Result { get; set; } = new TestInfo { Name = "测试结果", Value = false, Max = " ", Min = " " };
        public TestInfo PlayResult { get; set; } = new TestInfo { Name = "点亮结果", Value = true, Max = " ", Min = " " };

        public TestInfo CalibResult { get; set; } = new TestInfo { Name = "标定结果", Value = false, Max = " ", Min = " " };

        public TestInfo reproErr { get; set; } = new TestInfo { Name = "重投影误差", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo fx { get; set; } = new TestInfo { Name = "fx", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo fy { get; set; } = new TestInfo { Name = "fy", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo Cx { get; set; } = new TestInfo { Name = "Cx", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo Cy { get; set; } = new TestInfo { Name = "Cy", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo K1 { get; set; } = new TestInfo { Name = "K1", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo K2 { get; set; } = new TestInfo { Name = "K2", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo K3 { get; set; } = new TestInfo { Name = "K3", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo K4 { get; set; } = new TestInfo { Name = "K4", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo K5 { get; set; } = new TestInfo { Name = "K5", Value = float.NaN, Max = " ", Min = " " };
        public TestInfo K6 { get; set; } = new TestInfo { Name = "K6", Value = float.NaN, Max = " ", Min = " " };


    }
}
